package com.trestristesmicos.anahuac;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import android.widget.ImageButton;
import android.widget.TextView;

public class Programa2  extends Activity {
        

        
        /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.programa2);
        
        Typeface font1 = Typeface.createFromAsset(getAssets(), "fonts/ElektraLight.otf");
     
        TextView customText14 = (TextView)findViewById(R.id.TV_descripcionarea7);
        TextView customText15 = (TextView)findViewById(R.id.TV_tituloarea8);
        TextView customText16 = (TextView)findViewById(R.id.TV_descripcionarea8);
     
        TextView customText0 = (TextView)findViewById(R.id.TV_descripcionlicenciatura);
        
        customText0.setTypeface(font1);
        customText14.setTypeface(font1);
        customText15.setTypeface(font1);
        customText16.setTypeface(font1);
        
        
    
        
        ImageButton bt19 = (ImageButton) findViewById(R.id.IB_tour19);       
        bt19.setOnClickListener(new OnClickListener() {

                        
                        public void onClick(View arg0) {
                                // TODO Auto-generated method stub
                                animatedStartActivity(19);
                        }               
        });  
        
     
        
        ImageButton bt15 = (ImageButton) findViewById(R.id.IB_tour15);       
        bt15.setOnClickListener(new OnClickListener() {

                       
                        public void onClick(View arg0) {
                                // TODO Auto-generated method stub
                                animatedStartActivity(14);
                        }               
        }); 
        
        ImageButton bt16 = (ImageButton) findViewById(R.id.IB_tour16);       
        bt16.setOnClickListener(new OnClickListener() {

                       
                        public void onClick(View arg0) {
                                // TODO Auto-generated method stub
                                animatedStartActivity(15);
                        }               
        }); 
        
      
        
        
    }    
    
  
  
   
    
    
    private void animatedStartActivity(int position) {
                // we only animateOut this activity here.
                // The new activity will animateIn from its onResume() - be sure to implement it.
                
        final Intent intent;
        String video = "";
        switch(position) {
        case 0:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.coordinadoreconomia ;
                break;
        case 2:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.alumnaturismo ;
                break;
        case 4:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.alumnaadministracioncontaduria ;
                break;
  
        case 6:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.egresadamerca ;
                break;
        case 7:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.alumnomerca ;
                break; 
        case 10:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.egresadoderecho ;
                break;
        case 11:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.maestraderecho ;
                break;          
        case 14:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.coordinadorcomunicacion ;
                break;
        case 15:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.alumnocomunicacion ;
                break;
        case 19:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.egresadocomunicacion ;
                break;
        case 16:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.coordinadoringenieria ;
                break;
        case 17:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.egresadaingenieriaindustrial ;
                break;
        case 18:
                        video = (String)"android.resource://com.trestristesmicos.anahuac/" + R.raw.alumnaingenieriatecnologias ;
                break;
        
        }
        
        
        intent = new Intent(getApplicationContext(), VideoActivity.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
                intent.putExtra("uriVideo",video);
//              
                ActivitySwitcher.fadeOut(findViewById(R.id.container), getWindowManager(), new ActivitySwitcher.AnimationFinishedListener() {
                      
                        public void onAnimationFinished() {
                                startActivity(intent);
                        }
                });     
        }
    
    
      
    
    @Override
        protected void onResume() {
                // animateIn this activity
                ActivitySwitcher.fadeIn(findViewById(R.id.container), getWindowManager());
                super.onResume();
        }
   
    @Override
        public void finish() {
                // we need to override this to performe the animtationOut on each
                // finish.
                ActivitySwitcher.fadeOut(findViewById(R.id.container), getWindowManager(), new ActivitySwitcher.AnimationFinishedListener() {
                       
                        public void onAnimationFinished() {
                                Programa2.super.finish();
                                // disable default animation
                                overridePendingTransition(0, 0);
                        }
                });
        }
    
   
  
}
